//
//  UIWindow.h
//  CocosLib
//
//  Created by wangdi on 13-8-1.
//
//

#ifndef __CocosLib__UIWindow__
#define __CocosLib__UIWindow__

#include "UIPanel.h"

namespace storm
{
    class UIWindow : public UIWidget
    {
    public:
        virtual void onEnter();
        virtual void onExit();
        virtual void ccTouchesBegan(cocos2d::CCSet *pTouches, cocos2d::CCEvent *pEvent);
        virtual void ccTouchesMoved(cocos2d::CCSet *pTouches, cocos2d::CCEvent *pEvent);
        virtual void ccTouchesEnded(cocos2d::CCSet *pTouches, cocos2d::CCEvent *pEvent);
        virtual void ccTouchesCancelled(cocos2d::CCSet *pTouches, cocos2d::CCEvent *pEvent);
        
    public:
        CREATE_FUNC(UIWindow);
        
        UIWindow();
        virtual ~UIWindow();
        
        void AddPanel(UIPanel *pPanel, int zOrder);
        
    protected:
        bool FindTouchReveiver(cocos2d::CCTouch *pTouch);
    private:
        PanelList m_listPanel;
        cocos2d::CCTouch *m_pCurTouch;
    };
    
}

#endif /* defined(__CocosLib__UIWindow__) */
